package com.example.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * date:2017/9/26
 * time:9:55
 * author:LYH
 */
@CrossOrigin
@RestController
@RequestMapping("/hello")
public class HelloController {
    private static final Logger LOGGER = LoggerFactory.getLogger(HelloController.class);
    @Autowired
    JedisPool jedisPool;

    @PostMapping("/form")
    public Object handleForm(@RequestParam(name="name",required = true)String name,
                             @RequestParam(name = "age",required = true)String age){
        System.out.println("name:"+name+",age:"+age);
        Map<String,String> map = new HashMap();
        map.put("name",name);
        map.put("age",age);
        return map;
    }
}
